<include file="Public:header" />
<link type="text/css" href="__PUBLIC__/css/dynamic.css" rel="stylesheet" />
<link type="text/css" href="__PUBLIC__/css/flat/blue.css" rel="stylesheet">
<style>
    /**
     * 首页仪表盘
     **/
    .wall .span6, .wall .span4{
        margin-bottom:20px;
    }
    .dash-border{
        border-collapse: separate;
        border-left: 0;
        height:300px;
        /**border:1px solid lightgray;*/
        font-family:Microsoft Yahei;
        overflow:hidden;
    }
    .dash-border a{
        text-decoration: none;
    }
    .dash-border .content-chart{
        padding: 10px;
        width: auto;
        height: 79%;
        text-align: center;
        line-height: 15;
    }
    .dash-border .dash-title{
        font-size:15px;
        color:#000;
        height:41px;
        line-height: 2.5;
        padding-left:10px;
        background: #F8F9FA;
    }
    .dash-border .dash-swtich{
        float: right;
        padding-right: 10px;
        font-size: 12px;
        line-height: 3.8;
        color: #999;
    }
    .dash-border .cut-line{
        width: 97%;
        margin: 0 auto;
        border-bottom: 1px solid lightgray;
    }
    .content-item{
        font-size:13px;
        line-height:2.8;
    }
    .content-item .content-main{
        float:left;
        width: 95%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left:15px;
        color: #666;
        margin-top: 5px;

    }
    .content-item .content-time{
        float:right;
        padding-right:20px;
        color: #888;
    }
    .error_msg{
        font-size: 13px;
        color: #808080;
    }
    .notepad{
        width:94.7%;
        height:79%;
        margin:5px;
        resize: none;
    }
    .sort-item{
        margin-top:10px;
        border:1px solid #ddd;
        background-color:#fff;
    }
    .allmap{width:100%;height:150px;display:none;}
    .top-panel>ul>li a.active{font-weight:400;}
    .list0>li a{color:#93A6B5;}
    .list0>li a:active{color:#337ab7;}
    .col-span{
        float: left;
        position: relative;
        min-height: 1px;
        width: 20%;
        margin-left: 0px;
        text-align: center;
    }

    /*日志评论*/
    .talkcontent{
        clear: both;
        padding:10px;
    }
    .talkcontent .talknow{
        padding:10px;
    }
    .imgtx{
        width: 28px;
        float: left;
    }
    .neirong{
        margin-left: 42px;
        word-wrap: break-word;
        border-bottom:1px solid #eee;
    }
    .reply_talk{
        margin: 12px 0 12px 0;
    }
    .reply_content{
        border: 1px solid #aaa;
        min-height: 80px;
        padding: 10px;
        border-radius: 2px;
        margin-left: 43px;
    }
    .reply_content:empty::before{
        color:#cab0ba;
        content:attr(placeholder);
    }
    .btn_reply{
        margin-top: 0px;
        float: right;
    }
    .content_lanage
    {
        border: 1px solid #eee;
        min-height: 51px;
        padding: 10px;
        border-radius: 2px;
    }
    .content_lanage:empty::before{
        color:#cab0ba;
        content:attr(placeholder);
    }
    .talkcontent{padding:0px;}
    .talkcontent .talknow{padding:10px 0px;}
    .tsinfo{padding: 6px;line-height: 30px;}
    #table_div{margin-bottom: 15px;}

    /*任务相关*/
    .dropdown, .dropup{
        position: relative;
    }
    .dropdown-menu.bullet{
        margin-top: 12px;
    }
    .dropdown-menu{
        padding: 1px 0;
        margin-top: 3px;
        border-radius: 0;
        -webkit-box-shadow: 0 3px 12px rgba(0,0,0,.05);
        box-shadow: 0 3px 12px rgba(0,0,0,.05);
        -webkit-transition: .25s;
        -o-transition: .25s;
        transition: .25s;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1200;
        display: none;
        float: left;
        min-width: 160px;
        padding: 5px 0;
        margin: 2px 0 0;
        font-size: 14px;
        text-align: left;
        list-style: none;
        background-color: #fff;
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
        border: 1px solid #ccc;
        border: 1px solid #e4eaec;
        border-radius: 3px;
        -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
    }
    .dropdown-menu>li{
        padding: 0 3px;
        margin: 2px 0;
    }
    .taskboard-stage-header .dropdown-menu>li>a{
        padding: 6px 10px;
        -webkit-transition: background-color .25s;
        -o-transition: background-color .25s;
        transition: background-color .25s;
        display: block;
        padding: 3px 20px;
        clear: both;
        font-weight: 400;
        line-height: 1.6;
        color: #76838f;
        white-space: nowrap;
    }
    .dropdown-menu li .icon:first-child, .dropdown-menu li>a .icon:first-child{
        width: 1em;
        margin-right: .5em;
        text-align: center;
    }

    #right-sidebar-task{
        width: 50% !important;
        right: -60%;
        background-color: #fff;
        overflow: hidden;
        position: fixed;
        top: 60px;
        z-index: 1009;
        bottom: 0;
        box-shadow: 0px 2px 1px #888888;
    }
    .agile-list li{
        margin-bottom: -1px;
        border:none;
    }
    .taskboard-stage{
        height:90% !important;
    }
    .taskboard-stages{
        overflow-y:hidden !important;
    }

    .color-selector>li{
        position: relative;
        display: inline-block;
        width: 24px;
        height: 24px;
        margin: 0 5px 0 0;
        border-radius: 100%;
    }
    .bg-blue-600 label:before{
        background-color: #62a8ea!important;
    }
    .bg-green-600 label:before{
        background-color: #46be8a!important;
    }
    .bg-cyan-600 label:before{
        background-color: #57c7d4!important;
    }
    .bg-orange-600 label:before{
        background-color: #f2a654!important;
    }
    .bg-red-600 label:before{
        background-color: #f96868!important;
    }
    .bg-blue-grey-600 label:before{
        background-color: #526069!important;
    }
    .bg-purple-600 label:before{
        background-color: #926dde!important;
    }

    .bg-blue-600 label:after{
        background-color: #62a8ea!important;
    }
    .bg-green-600 label:after{
        background-color: #46be8a!important;
    }
    .bg-cyan-600 label:after{
        background-color: #57c7d4!important;
    }
    .bg-orange-600 label:after{
        background-color: #f2a654!important;
    }
    .bg-red-600 label:after{
        background-color: #f96868!important;
    }
    .bg-blue-grey-600 label:after{
        background-color: #526069!important;
    }
    .bg-purple-600 label:after{
        background-color: #926dde!important;
    }
    .radio label:before{
        width:24px;
        height:24px;
    }
    .radio label:after{
        left:6px;
        top: 4px;
        font-family: "FontAwesome";
        content: "\f00c";
        color: #fff;
    }
    .img-circle{
        margin-right:0px;
    }
    .list-group-item:hover{
        background-color: #fafafb !important;
    }
    .taskboard-list .list-group-item .task-members{
        float:left;
    }
    .action-wrap{
        float:left;
        width:100%;
        height:10%;
        min-height: 40px;
        background-color: #fff;
    }
</style>
<script type="text/javascript" src="__PUBLIC__/js/chart/highcharts.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/mychart/macarons.js"></script>
<script src="__PUBLIC__/js/mychart/echarts-plain.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery.e-calendar.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/chart/funnel.js"></script>
<!-- echarts -->
<script type="text/javascript" src="__PUBLIC__/js/echarts/echarts.js"></script>
<!-- nice-scroll -->
<script src="__PUBLIC__/style/js/plugins/nice-scroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<!--the css for jquery.mCustomScrollbar-->
<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
<!--the css for this plugin-->
<link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
<script>
    $(function () {
        $("#table_div").height(window.innerHeight - $("#table_div").offset().top - 10);
        $(window).resize(function () {
            $("#table_div").height(window.innerHeight - $("#table_div").offset().top - 10);
        })
        var scroll_width = 5;
        $(".nicescroll").niceScroll({
            cursorcolor: "#ccc", //#CC0071 光标颜色
            cursoropacitymax: 1, //改变不透明度非常光标处于活动状态（scrollabar“可见”状态），范围从1到0
            touchbehavior: false, //使光标拖动滚动像在台式电脑触摸设备
            cursorwidth: scroll_width + "px", //像素光标的宽度
            cursorborder: "0", //     游标边框css定义
            cursorborderradius: "5px", //以像素为光标边界半径
            autohidemode: false, //是否隐藏滚动条
            zindex: 100,
            background: "#F3F3F5", //滚动条背景色
        });
    })
</script>

<div class="page-wrapper wrapper wrapper-content animated fadeIn" >
    <div class="row">
        <include file="Public:alert" />
        <div class="col-sm-12" style="margin-bottom: 20px;">
            <div class="row">
                <div class="col-sm-8" >
                    <div class="table-content container-fluid ibox-title">
                        <div class="col-sm-12">
                            <div class="col-sm-1">
                                <span style="font-size:18px;line-height:25px;color: #000;vertical-align: middle;">简报</span>
                            </div>
                            <div class="col-sm-11">
                                <div class="col-span">
                                    <span style="color: #000;">新增客户</span>
                                    <div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['customer_count'][0]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <span style="color: #000;">新增联系人</span>
                                    <div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['contacts_count'][0]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <span style="color: #000;">新增项目</span>
                                    <div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['business_count'][0]}个</span></div>
                                </div>
                                <!--<div class="col-span">-->
                                <!--<span style="color: #000;">新增沟通日志</span>-->
                                <!--<div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['log_count'][0]}篇</span></div>-->
                                <!--</div>-->
                                <!--<div class="col-span">-->
                                <!--<span style="color: #000;">工作日志</span>-->
                                <!--<div style="margin-top:10px;">-->
                                <!--<if condition ="$mylog_count_today gt 0">-->
                                <!--<span style="font-size:15px;"><i class="fa fa-check-circle" style="color:#19AA8D;"></i>&nbsp;&nbsp;今日已完成</span>-->
                                <!--<else/>-->
                                <!--<a href="{:U('log/mylog_add')}" style="color:#999;" title="点击跳转日志添加页面"><span style="font-size:15px;"><i class="fa fa-exclamation-circle" style="color:#FFCC00;"></i>&nbsp;&nbsp;今日未填写</span></a>-->
                                <!--</if>-->
                                <!--</div>-->
                                <!--</div>-->
<!--                                <div class="col-span">
                                    <span style="color: #000;">新增人才</span>
                                    <div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['resume_count'][0]}个</span></div>
                                </div>-->
                                <div class="col-span">
                                    <span style="color: #000;">新增合同</span>
                                    <div style="margin-top:10px;"><span style="font-size:15px;">{$anly_count['contract_count'][0]}个</span></div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="table-content container-fluid ibox-title" style="border-top: none;">
                        <div class="col-sm-12" style="margin-bottom: 5px;">
                            <div class="col-sm-1" style="padding:0px;text-align: center;">
                                <span style="font-size:13px;line-height:25px;color: #000;">本周新增</span>
                            </div>
                            <div class="col-sm-11">
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['customer_count'][1]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contacts_count'][1]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['business_count'][1]}个</span></div>
                                </div>
<!--                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['resume_count'][1]}个</span></div>
                                </div>-->
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contract_count'][1]}个</span></div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                        <div class="col-sm-12" style="margin-bottom: 5px;">
                            <div class="col-sm-1" style="padding:0px;text-align: center;">
                                <span style="font-size:13px;line-height:25px;color: #000;">本月新增</span>
                            </div>
                            <div class="col-sm-11">
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['customer_count'][2]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contacts_count'][2]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['business_count'][2]}个</span></div>
                                </div>
<!--                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['resume_count'][2]}个</span></div>
                                </div>-->
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contract_count'][2]}个</span></div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                        <div class="col-sm-12" style="margin-bottom: 5px;">
                            <div class="col-sm-1" style="padding:0px;text-align: center;">
                                <span style="font-size:13px;line-height:25px;color: #000;">本年新增</span>
                            </div>
                            <div class="col-sm-11">
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['customer_count'][3]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contacts_count'][3]}个</span></div>
                                </div>
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['business_count'][3]}个</span></div>
                                </div>
<!--                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['resume_count'][3]}个</span></div>
                                </div>-->
                                <div class="col-span">
                                    <div ><span style="font-size:15px;">{$anly_count['contract_count'][3]}个</span></div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="table-content container-fluid ibox-title" style="margin-top: 10px;display: none;">
                        <div class="col-sm-12">
                            <div class="col-sm-1">
                                <span style="font-size:18px;line-height:25px;color: #000;">指标</span>
                            </div>
                            <div class="col-sm-11">
                                <div class="col-span" style="padding-left: none;">
                                    <span style="color: #000;">收款进度</span>
                                    <div class="project-completion" style="margin-top:10px;">
                                        <small>{$anly_count['schedule']}%</small>
                                        <div class="progress progress-mini">
                                            <div style="width: {$anly_count['schedule']}%;" class="progress-bar"></div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-span" style="padding-left: none;">
                                    <span style="color: #000;">历史收款金额</span>
                                    <div style="margin-top:10px;"><span style="font-size:20px;color: #ffb173;">{$anly_count['sum_price']}</span>元</div>
                                </div>
                                <div class="col-span" style="padding-left: none;">
                                    <span style="color: #000;">本周收款金额</span>
                                    <div style="margin-top:10px;"><span style="font-size:20px;color: #ffb173;">{$anly_count['sum_price_week']}</span>元</div>
                                </div>
                                <div class="col-span" style="padding-left: none;">
                                    <span style="color: #000;">本月收款金额</span>
                                    <div style="margin-top:10px;"><span style="font-size:20px;color: #ffb173;">{$anly_count['sum_price_month']}</span>元</div>
                                </div>
                                <div class="col-span" style="padding-left: none;">
                                    <span style="color: #000;">全年收款总额</span>
                                    <div style="margin-top:10px;"><span style="font-size:20px;color: #ffb173;">{$anly_count['sum_price_year']}</span>元</div>
                                </div>
                                <div style="clear:both;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="row" id="widgets" style="">
                        <div class="wall">
                            <div class="col-sm-12 sort-list">
                                <volist name="widget" id="vo">
                                    <?php $vo['redirect'] = $vo['widget']; ?>
                                    {:W('Common', $vo)}
                                </volist>
<!--                                <div class="col-sm-6 sort-item" style="background: #fff;">
                                    <a id="add" style="width: 100%;height: 100%;float: left;" title="添加仪表盘">
                                        <div class="dash-border">
                                            <div class="content-chart" style="font-size: 15px;color: #7D899C; width: 100%; height: 100%;">
                                                <div style="float: left;margin:0 auto;width: 100%;">
                                                    <i class="fa fa-filter" style="#7D899C;"></i>&nbsp; 添加仪表盘
                                                </div>
                                            </div>
                                        </div>
                                    </a>
                                </div>-->
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4" style="background-color:#fff;border: 1px solid #ccc;">
                    <div class="ibox-title" style="border: none;">
                        <div class="pull-left">
                            <span style="height:35px;font-size:14px;color: #000;">工作圈</span>
                        </div>
                        <div class="pull-right" id="log_add" style="display: none;">
                            <a href="{:U('log/mylog_add')}"><span style="height:35px;font-size:14px;color: #000;">写日志</span></a>
                        </div>
                    </div>
                    <div class="ibox-title" style="border-width: 1px 0 0;">
                        <div class="top-panel" style="border-bottom:0px;">
                            <ul class="list0 pull-left" style="margin-left:-40px;">
                                <li><a href="javascript:void(0)" class="dynamic_type active" id="crm" rel="crm">全部动态</a></li>
                                <li><a href="javascript:void(0)" class="dynamic_type" id="customer" rel="customer">客户相关</a></li>
                                <!--<li><a href="javascript:void(0)" class="dynamic_type" id="product" rel="product">人才相关</a></li>-->
                                <!--<li><a href="javascript:void(0)" class="dynamic_type" id="log" rel="log" >日志相关</a></li>-->
                                <li><a href="javascript:void(0)" class="dynamic_type" id="business" rel="business" >项目相关</a></li>
                                <!--<li><a href="javascript:void(0)" class="dynamic_type" id="sign" rel="sign" >签到相关</a></li>-->
                            </ul>
                        </div>
                    </div>
                    <input type="hidden" id="dynamic_type" value="crm" />
                    <input type="hidden" id="p" value="{$p}"/>
                    <input type="hidden" id="load" value="1"/>
                    <div class="middle-content nicescroll" id="table_div" style="margin-top:0px;width:100%;border-bottom: 1px solid #ddd;" >
                        <empty name="actionLog">
                            <div class="alert alert-info">暂无动态信息</div>
                            <else />
                            <div id="list">
                                <volist name="actionLog" id="vo">
                                    <div class="dy-content" id="anchor_{$vo.log_id}">
                                        <div class="title3">
                                            <if condition="empty($vo['creator']['thumb_path'])">
                                                <img src="__PUBLIC__/img/avatar_default.png" class="avatar"/>
                                                <else />
                                                <img src="{$vo.creator.thumb_path}" class="avatar"/>
                                            </if>
                                        </div>
                                        <div class="role0">
                                            <p>
                                                <a href="javascript:void(0)" class="role_info" rel="{$vo.creator.role_id}">{$vo.creator.user_name}（{$vo.creator.department_name} - {$vo.creator.role_name}）</a>
                                                |<span style="padding-left:10px;color: #000;">{$vo.dynamic}</span>
                                            </p>
                                        </div>
                                        <if condition="$vo['module_name'] == 'sign'">
                                            <div class="conent0" style="width:100%;">
                                                <img style="height:15px;vertical-align:text-bottom;" src="__PUBLIC__/img/location.png"/>
                                                <span style="color:#666">{$vo.address}</span>
                                                <input class="longitude" type="hidden" rel="{$vo.y}"/>
                                                <a href="javascript:void(0);" style="font-size:12px;" class="pull-right map" >显示地图</a>
                                                <div id="allmap{$key+1}" rel="allmap{$key+1}" class="allmap"></div>
                                                <input class="latitude" type="hidden" rel="{$vo.x}"/>
                                            </div>
                                            <div class="conent0">
                                                <span style="color:#000">相关客户：<a href="{:U('customer/view','id='.$vo['customer_info']['customer_id'])}">{$vo['customer_info']['name']}</a></span>
                                            </div>
                                            <div class="conent0">
                                                <span style="color:#000">签到说明：{$vo.log}</span>
                                            </div>
                                            <div class="conent0">
                                                <div style="color:#000">现场照片：</div>
                                                <volist name="vo['sign_img']" id="v">
                                                    <div class="box-secondary" rel="{$vo.img_id}" style="width:30%;float:left;">
                                                        <a href="{$v.path}" target="_self" class="litebox" data-litebox-group="group-1">
                                                            <img src="{$v.path}" class="thumbnail thumb100">
                                                        </a>
                                                    </div>
                                                </volist>
                                                <div style="clear:both;"></div>
                                            </div>
                                            <elseif condition = "$vo['module_name'] == 'log'"/>
                                            <div class="conent0" style="font-size: 12px;">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
                                            <div class="conent0" id="content_{$vo['log_id']}" style="word-wrap: break-word;word-break: normal;padding:10px 20px;padding-top: 10px;">{$vo['cut_content']}</div>
                                            <if condition = "$vo['content_open'] eq 1">
                                                <div class="conent0" style="padding: 0px;">
                                                    <div id="open_{$vo['log_id']}" class="panel-collapse collapse">
                                                        <div class="panel-body" style="word-wrap: break-word;word-break: normal;padding-left: 20px;padding-top: 10px;">
                                                            {$vo.log_content}
                                                        </div>
                                                    </div>
                                                    <div class="panel-heading" style="padding-left: 20px;">
                                                        <a data-toggle="collapse" data-parent="#accordion"
                                                           href="#open_{$vo['log_id']}" class="hide_content" rel="{$vo['log_id']}" rel1="0">展开全文</a>
                                                    </div>
                                                </div>
                                            </if>
                                            <if condition = "$vo['log_files']">
                                                <div class="conent0" style="padding-left: 20px;padding-right:10px;margin-right: 10px;border: 1px dashed #d8e3ef;">
                                                    <span class="tsinfo"><img src="__PUBLIC__/img/addFile.png"/><span class="fujian">附件&nbsp;({$vo['file_count']})</span></span>
                                                    <volist name="vo['log_files']" id="files">
                                                        <div class="file_tr" style="padding: 6px;">
                                                            <img src="__PUBLIC__/productImg/{$files['pic']}">&nbsp;
                                                            <a <if condition="in_array(getExtension($files['name']),imgFormat())">class="litebox_file" href="{$files['file_path']}" data-litebox-group="group-{$vo['log_id']}" title="点击查看大图"<else/>href="javascript:;" file="{$files.file_path}" filename="{$files.name}" onclick="filedown(this);"</if> title="{$files['name']}">{$files.cut_name}</a><span style="color:#646464;">&nbsp;(&nbsp;{$files['size']}KB&nbsp;)</span>&nbsp;&nbsp;<a class="controls_file" style="float: right;display: none;" href="javascript:void(0);" file="{$files.file_path}" filename="{$files.name}" onclick="filedown(this);" title="{$files['name']}">下载</a>
                                                        </div>
                                                    </volist>
                                                </div>
                                            </if>
                                            <div class="conent0" style="padding:10px 20px;height: 35px;">
                                                <if condition = "$vo['comment_count'] gt 0">
                                                    <div class="pull-left ">
                                                        <a href="javascript:void(0)" class="log_comment" id="log_comment_{$vo['action_id']}" rel="{$vo['log_id']}" rel1="0" rel2 = "{$vo['action_id']}">展开评论</a>
                                                    </div>
                                                </if>
                                                <div class="pull-right" style="margin-right: 5px;">
                                                    <a href="javascript:void(0)" class="reply" rel="{$vo['action_id']}" rel1="0"><span id="reply_{$vo['action_id']}" style="height:35px;font-size:14px;">回复</span></a>
                                                </div>
                                            </div>
                                            <div class="conent0" id="reparynow_{$vo['action_id']}" style="padding-left: 20px;padding-right: 20px;display: none;">
                                                <div id="content_lanage_{$vo['action_id']}" class="content_lanage" rel="{$vo['action_id']}" contenteditable="true" placeholder="添加回复..."></div>
                                                <div style="margin-top: 5px;">
                                                    <input type="image" id="btn_emoji_{$vo['action_id']}" src="__PUBLIC__/img/emoji.png" />
                                                    <button disabled="true" id="but_sub_{$vo['action_id']}" style="display: none;" class="btn btn-primary subit add_language pull-right" rel="{$vo['action_id']}" type="button">发 表</button>
                                                </div>
                                            </div>
                                            <div class="conent0" style="padding-left: 20px;padding-right: 20px;">
                                                <div class="talkcontent" rel="{$vo['log_id']}" id="talkcontent_{$vo['action_id']}">

                                                </div>
                                            </div>
                                            <elseif condition = "$vo['module_name'] == 'task'"/>
                                            <div class="conent0" style="font-size: 12px;">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
                                            <div class="conent0"><a class="task_view" href="javascript:void(0);" rel="{$vo['action_id']}">{$vo.type}</a></div>
                                            <else/>
                                            <div class="conent0" style="font-size: 12px;">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
                                            <div class="conent0">{$vo.type}</div>
                                        </if>
                                    </div>
                                </volist>
                            </div>
                        </empty>
                    </div>
                    <div style="clear:both;"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>

<div id="dialog-message" style="display:none" title="{:L('ADD_A_PANEL_COMPONENT')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div id="dialog-message2" style="display:none" title="{:L('MODIFY_THE_PANEL_COMPONENT')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>
<div id="dialog-role-info" style="display:none" title="{:L('DIALOG_USER_INFO')}">
    <div class="spiner-example">
        <div class="sk-spinner sk-spinner-three-bounce">
            <div class="sk-bounce1"></div>
            <div class="sk-bounce2"></div>
            <div class="sk-bounce3"></div>
        </div>
    </div>
</div>

<include file="Public:mapbaidu" />
<link href="__PUBLIC__/css/litebox.css" rel="stylesheet" type="text/css">
<script src="__PUBLIC__/js/litebox.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/js/images-loaded.min.js" type="text/javascript"></script>
<!--(Optional) the js for jquery.mCustomScrollbar's addon-->
<script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
<!--the js for jquery.mCustomScrollbar-->
<script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
<!--the js for this plugin-->
<script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>
<script type="text/javascript">


                                                                                                            $(document).on('mouseenter', '.file_tr', function () {
                                                                                                                $(this).find(".controls_file").show();
                                                                                                            });
                                                                                                            $(document).on('mouseleave', '.file_tr', function () {
                                                                                                                $(this).find(".controls_file").hide();
                                                                                                            });
//流加载
                                                                                                            $(document).ready(function () {
                                                                                                                var loading = false;  //状态标记
                                                                                                                var deviation = 10; //事件偏移量
                                                                                                                var nScrollHight = 0; //滚动距离总长(注意不是滚动条的长度)
                                                                                                                var nScrollTop = 0;   //滚动到的当前位置
                                                                                                                var nDivHight = $("#table_div").height();
                                                                                                                var scrollTop = $("#table_div").scrollTop();

                                                                                                                $("#table_div").scroll(function () {
                                                                                                                    var type = $('#dynamic_type').attr('value');
                                                                                                                    var p = $('#p').val();//1
                                                                                                                    var load = $('#load').val();//1
                                                                                                                    nScrollHight = $(this)[0].scrollHeight;
                                                                                                                    nScrollTop = $(this)[0].scrollTop;
                                                                                                                    if (loading) {
                                                                                                                        return false;
                                                                                                                    }
                                                                                                                    if (nScrollTop + nDivHight + deviation >= nScrollHight && load == 1) {
                                                                                                                        loading = true;
                                                                                                                        // alert("滚动条到底部了");
                                                                                                                        temp_loading = "";
                                                                                                                        temp_loading = "<div class='loading' id='loading'><div class='spiner-example'><div class='sk-spinner sk-spinner-three-bounce'><div class='sk-bounce1'></div><div class='sk-bounce2'></div><div class='sk-bounce3'></div></div></div></div>";
                                                                                                                        $("#message_div").scrollTop(nScrollTop + deviation + 200);
                                                                                                                        $("#list").append(temp_loading);
                                                                                                                        var temp = "";
                                                                                                                        var no_data = "";
                                                                                                                        p++;
                                                                                                                        $('#p').val(p);
                                                                                                                        $.ajax({
                                                                                                                            type: 'get',
                                                                                                                            url: 'index.php?m=index&a=dynamic_data&p=' + p + '&by=' + type,
                                                                                                                            async: false,
                                                                                                                            success: function (data) {
                                                                                                                                temp = "";
                                                                                                                                $('#no_data').remove();
                                                                                                                                if (data.status == 1) {
                                                                                                                                    $.each(data.data, function (k, v) {
                                                                                                                                        var ke = k + 1;
                                                                                                                                        temp += "<div class='dy-content' id='anchor_" + v.log_id + "'><div class = 'title3'>";
                                                                                                                                        if (v.creator.thumb_path) {
                                                                                                                                            temp += "<img src='" + v.creator.thumb_path + "' class='avatar'/>";
                                                                                                                                        } else {
                                                                                                                                            temp += "<img src='__PUBLIC__/img/avatar_default.png' class='avatar'/>";
                                                                                                                                        }
                                                                                                                                        temp += "</div><div class='role0'><p><a href='javascript:void(0)' class='role_info' rel='" + v.creator.role_id + "'>" + v.creator.user_name + "（" + v.creator.department_name + " - " + v.creator.role_name + "）</a>|<span style='padding-left:10px;color:#000;'>" + v.dynamic + "</span></p></div>";
                                                                                                                                        if (v.module_name == 'sign') {
                                                                                                                                            temp += "<div class='conent0' style='width:100%;'><img style='height:15px;vertical-align:text-bottom;' src='__PUBLIC__/img/location.png'></img><span style='color:#000'>" + v.address + "</span><input class='longitude' type='hidden' rel='" + v.y + "'/><a href='javascript:void(0);' style='font-size:12px;' class='pull-right map' >显示地图</a><div id='allmap" + ke + "' rel='allmap" + ke + "' class='allmap'></div><input class='latitude' type='hidden' rel='" + v.x + "'/></div><div class='conent0'><span style='color:#000'>相关客户：<a href='{:U('customer/view','id='." + v.customer_info.customer_id + ")}'>" + v.customer_info.name + "</a></span></div><div class='conent0'><span style='color:#000'>签到说明：" + v.log + "</span></div><div class='conent0'><div style='color:#000'>现场照片：</div>";
                                                                                                                                            $.each(v.sign_img, function (key, val) {
                                                                                                                                                temp += "<div class='box-secondary' rel='" + val.img_id + "' style='width:30%;float:left;'><a href='" + val.path + "' target='_self' class='litebox' data-litebox-group='group-1'><img src='" + val.path + "' class='thumbnail thumb100'></a></div>";
                                                                                                                                            })
                                                                                                                                            temp += "<div style='clear:both;'></div></div>";
                                                                                                                                        } else if (v.module_name == 'log') {
                                                                                                                                            temp += "<div class='conent0' style='font-size: 12px;'>" + v.create_time + "</div><div class='conent0' id='content_'+v.log_id style='word-wrap: break-word;word-break: normal;padding:10px 20px;padding-top: 10px;'>" + v.cut_content + "</div>";
                                                                                                                                            if (v.content_open == 1) {
                                                                                                                                                temp += "<div class='conent0' style='padding: 0px;'><div id='open_'+v.log_id class='panel-collapse collapse'><div class='panel-body' style='word-wrap: break-word;word-break: normal;padding-left: 20px;padding-top: 10px;'>" + v.log_content + "</div></div><div class='panel-heading' style='padding-left: 20px;'><a data-toggle='collapse' data-parent='#accordion' href='#open_'+v.log_id class='hide_content' rel='" + v.log_id + "' rel1='0'>展开全文</a></div></div>";
                                                                                                                                            }
                                                                                                                                            if (v.log_files != '') {
                                                                                                                                                temp += "<div class='conent0' style='padding-left: 20px;padding-right:10px;margin-right: 10px;border: 1px dashed #d8e3ef;'><span class='tsinfo'><img src='__PUBLIC__/img/addFile.png'/><span class='fujian'>附件&nbsp;(" + v.file_count + ")</span></span>";

                                                                                                                                                $.each(v.log_files, function (key, files) {
                                                                                                                                                    temp += "<div style='padding: 6px;'><img src='__PUBLIC__/productImg/" + files.pic + "'>&nbsp;";
                                                                                                                                                    if (js_getExtension(files.name)) {
                                                                                                                                                        temp += "<a class='litebox_file' href='" + files.file_path + "' data-litebox-group='group-" + v.log_id + "' title='点击查看大图' title='" + files.name + "'>" + files.cut_name + "</a><span style='color:#646464;'>&nbsp;(&nbsp;" + files.size + "KB&nbsp;)</span>&nbsp;&nbsp;<a style='float: right;' href='javascript:void(0);' file='" + files.file_path + "' filename='" + files.name + "' onclick='filedown(this);' title='" + files.name + "'>下载</a>";
                                                                                                                                                    }
                                                                                                                                                    temp += "</div>";
                                                                                                                                                })
                                                                                                                                                temp += "</div>";
                                                                                                                                            }
                                                                                                                                            temp += "<div class='conent0' style='padding:10px 20px;height: 35px;'>";
                                                                                                                                            if (v.comment_count > 0) {
                                                                                                                                                temp += "<div class='pull-left '><a href='javascript:void(0)' class='log_comment' id='log_comment_+" + v.action_id + "' rel='" + v.log_id + "' rel1='0' rel2 = '" + v.action_id + "'>展开评论</a></div>";
                                                                                                                                            }
                                                                                                                                            temp += "<div class='pull-right' style='margin-right: 5px;'><a href='javascript:void(0)' class='reply' rel='" + v.action_id + "' rel1='0'><span id='reply_" + v.action_id + "' style='height:35px;font-size:14px;'>回复</span></a></div></div><div class='conent0' id='reparynow_" + v.action_id + "' style='padding-left: 20px;padding-right: 20px;display: none;'><div id='content_lanage_" + v.action_id + "' class='content_lanage' rel='" + v.action_id + "' contenteditable='true' placeholder='添加回复...'></div><div style='margin-top: 5px;'><input type='image' id='btn_emoji_" + v.action_id + "' src='__PUBLIC__/img/emoji.png' /><button disabled='true' id='but_sub_" + v.action_id + "' style='display: none;' class='btn btn-primary subit add_language pull-right' rel='" + v.action_id + "' type='button'>发 表</button></div></div><div class='conent0' style='padding-left: 20px;padding-right: 20px;'><div class='talkcontent' rel='" + v.log_id + "' id='talkcontent_" + v.action_id + "'></div></div>";
                                                                                                                                        } else if (v.module_name == 'task') {
                                                                                                                                            temp += "<div class='conent0' style='font-size: 12px;'>" + v.create_time + "</div><div class='conent0'><a class='task_view' href='javascript:void(0);' rel='" + v.action_id + "'>" + v.type + "</a></div>";
                                                                                                                                        } else {
                                                                                                                                            temp += "<div class='conent0' style='font-size: 12px;'>" + v.create_time + "</div><div class='conent0'>" + v.type + "</div>";
                                                                                                                                        }
                                                                                                                                        temp += "</div>";
                                                                                                                                    })
                                                                                                                                } else {
                                                                                                                                    p--;
                                                                                                                                    $('#p').val(p);
                                                                                                                                    // alert_crm(data.data);
                                                                                                                                    no_data = "<p id='no_data' style='margin-top: 20px;text-align: center;'>没有更多数据</p>";
                                                                                                                                    $('#load').val('0');
                                                                                                                                }
                                                                                                                            }
                                                                                                                        });
                                                                                                                        if (no_data == '') {
                                                                                                                            setTimeout(function () {
                                                                                                                                $("#message_div").scrollTop(nScrollTop + deviation - 200);
                                                                                                                                $('#loading').remove();
                                                                                                                                $("#list").append(temp);
                                                                                                                                loading = false;
                                                                                                                            }, 1500);   //模拟延迟
                                                                                                                        } else {
                                                                                                                            setTimeout(function () {
                                                                                                                                $("#message_div").scrollTop(nScrollTop + deviation);
                                                                                                                                $('#loading').remove();
                                                                                                                                $("#list").append(no_data);
                                                                                                                                loading = true;
                                                                                                                            }, 1500);   //模拟延迟
                                                                                                                        }

                                                                                                                        //litebox
                                                                                                                        $('.litebox').liteBox({
                                                                                                                              revealSpeed: 400,
                                                                                                                              background: 'rgba(0,0,0,.8)',
                                                                                                                              overlayClose: true,
                                                                                                                              escKey: true,
                                                                                                                              navKey: true,
                                                                                                                              errorMessage: '图片加载失败.'
                                                                                                                        });

                                                                                                                        $('.litebox_file').liteBox({
                                                                                                                              revealSpeed: 400,
                                                                                                                              background: 'rgba(0,0,0,.8)',
                                                                                                                              overlayClose: true,
                                                                                                                              escKey: true,
                                                                                                                              navKey: true,
                                                                                                                              errorMessage: '图片加载失败.'
                                                                                                                        });

                                                                                                                        //地图
                                                                                                                        $("#list").on("click", ".map", function () {
                                                                                                                            $(this).next('.allmap').slideToggle('show');
                                                                                                                            var a = $(this).siblings('.longitude').attr('rel');
                                                                                                                            var b = $(this).siblings('.latitude').attr('rel');
                                                                                                                            var vals = $(this).next('.allmap').attr('rel');
                                                                                                                            var url = "{:U('index/gettranslocation')}" + "&longtitude=" + a + "&latitude=" + b;
                                                                                                                            $.get(url, function (data) {
                                                                                                                                var x = data.data.x;
                                                                                                                                var y = data.data.y;
                                                                                                                                setTimeout("mapInit(" + y + "," + x + "," + vals + ")", 1000);
                                                                                                                            })
                                                                                                                        });
                                                                                                                    }
                                                                                                                    if (nScrollTop == 0) {  //滚动到头部执行事件
                                                                                                                        //alert("我到头部了");
                                                                                                                    }
                                                                                                                });
                                                                                                            });

//获取文件名后缀(是否图片类型)
                                                                                                            function js_getExtension(file) {
                                                                                                                var file = file;
                                                                                                                var filename = file.replace(/.*(\/|\\)/, "");
                                                                                                                var fileExt = (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename.toLowerCase()) : '';
                                                                                                                var img_arr = ["jpg", "jpeg", "gif", "png"];
                                                                                                                if ($.inArray(fileExt, img_arr)) {
                                                                                                                    return true;
                                                                                                                } else {
                                                                                                                    return false;
                                                                                                                }
                                                                                                            }

//动态类型切换加载
                                                                                                            $('.dynamic_type').click(function () {
                                                                                                                var type = $(this).attr('rel');
                                                                                                                $('#dynamic_type').val(type);
                                                                                                                $(".dynamic_type").removeClass("active");	//移除样式
                                                                                                                $('#' + type).addClass("active"); //追加样式
                                                                                                                var detail_html = '<div class="spiner-example"><div class="sk-spinner sk-spinner-three-bounce"><div class="sk-bounce1"></div><div class="sk-bounce2"></div><div class="sk-bounce3"></div></div></div>';
                                                                                                                $('#table_div').html(detail_html);
                                                                                                                $('#p').val(1);
                                                                                                                $('#table_div').load("{:U('index/dynamic_data')}", {by: type, date_type: 1});
                                                                                                                if (type == 'log') {
                                                                                                                    $('#log_add').show();
                                                                                                                } else {
                                                                                                                    $('#log_add').hide();
                                                                                                                }

                                                                                                                $(document).on('click', '.role_info', function () {
                                                                                                                    $role_id = $(this).attr('rel');
                                                                                                                    $('#dialog-role-info').dialog('open');
                                                                                                                    $('#dialog-role-info').load('{:U("user/dialoginfo","id=")}' + $role_id);
                                                                                                                });
                                                                                                                $(document).ready(function () {
                                                                                                                    //litebox
                                                                                                                    $('.litebox').liteBox({
                                                                                                                          revealSpeed: 400,
                                                                                                                          background: 'rgba(0,0,0,.8)',
                                                                                                                          overlayClose: true,
                                                                                                                          escKey: true,
                                                                                                                          navKey: true,
                                                                                                                          errorMessage: '图片加载失败.'
                                                                                                                    });

                                                                                                                    $('.litebox_file').liteBox({
                                                                                                                          revealSpeed: 400,
                                                                                                                          background: 'rgba(0,0,0,.8)',
                                                                                                                          overlayClose: true,
                                                                                                                          escKey: true,
                                                                                                                          navKey: true,
                                                                                                                          errorMessage: '图片加载失败.'
                                                                                                                    });
                                                                                                                });

                                                                                                                //地图
                                                                                                                $('#list').on("click", ".map", function () {
                                                                                                                    $(this).next('.allmap').slideToggle('show');
                                                                                                                    var a = $(this).siblings('.longitude').attr('rel');
                                                                                                                    var b = $(this).siblings('.latitude').attr('rel');
                                                                                                                    var vals = $(this).next('.allmap').attr('rel');
                                                                                                                    var url = "{:U('index/gettranslocation')}" + "&longtitude=" + a + "&latitude=" + b;
                                                                                                                    $.get(url, function (data) {
                                                                                                                        var x = data.data.x;
                                                                                                                        var y = data.data.y;
                                                                                                                        setTimeout("mapInit(" + y + "," + x + "," + vals + ")", 1000);
                                                                                                                    })
                                                                                                                });
                                                                                                            });

//展开全文
                                                                                                            $(document).on('click', '.hide_content', function () {
                                                                                                                var rel = $(this).attr('rel');
                                                                                                                var rel1 = $(this).attr('rel1');
                                                                                                                if (rel1 == 0) {
                                                                                                                    $('#content_' + rel).hide();
                                                                                                                    $(this).attr('rel1', 1);
                                                                                                                    $(this).html('收起全文');
                                                                                                                } else {
                                                                                                                    $('#content_' + rel).show();
                                                                                                                    $(this).attr('rel1', 0);
                                                                                                                    $(this).html('展开全文');
                                                                                                                }
                                                                                                            });

                                                                                                            /**日志评论start**/

//最后一个样式
                                                                                                            $(".neirong:last").css('border', 'none');
                                                                                                            //展开评论
                                                                                                            $(document).on('click', '.log_comment', function () {
                                                                                                                var log_id = $(this).attr('rel2');
                                                                                                                var action_id = $(this).attr('rel');
                                                                                                                var rel1 = $(this).attr('rel1');
                                                                                                                if (rel1 == 0) {
                                                                                                                    //加载效果
                                                                                                                    var load = "<div class='spiner-example'><div class='sk-spinner sk-spinner-three-bounce'><div class='sk-bounce1'></div><div class='sk-bounce2'></div><div class='sk-bounce3'></div></div></div>";
                                                                                                                    $('#talkcontent_' + log_id).html(load);
                                                                                                                    setTimeout(function () {
                                                                                                                        var send_role_id = $('#send_role_id').val();
                                                                                                                        var url = "{:U('log/commentShow')}";
                                                                                                                        $('#talkcontent_' + log_id).load(url, {log_id: log_id});
                                                                                                                    }, 500);   //模拟延迟
                                                                                                                    $(this).attr('rel1', 1);
                                                                                                                    $(this).html('收起评论');
                                                                                                                } else {
                                                                                                                    $('#talkcontent_' + log_id).html('');
                                                                                                                    $(this).attr('rel1', 0);
                                                                                                                    $(this).html('展开评论');
                                                                                                                }
                                                                                                            });

//回复
                                                                                                            $(document).on('click', '.reply', function () {
                                                                                                                var log_id = $(this).attr('rel');
                                                                                                                var rel1 = $(this).attr('rel1');
                                                                                                                if (rel1 == 0) {
                                                                                                                    $("#reparynow_" + log_id).slideToggle("3000");
                                                                                                                    $(this).attr('rel1', 1);
                                                                                                                    $("#content_lanage_" + log_id).emoji({
                                                                                                                        button: "#btn_emoji_" + log_id,
                                                                                                                        showTab: true,
                                                                                                                        animation: 'slide',
                                                                                                                        icons: [{
                                                                                                                                name: "小表情",
                                                                                                                                path: "__PUBLIC__/emoji/img/tieba/",
                                                                                                                                maxNum: 50,
                                                                                                                                file: ".jpg",
                                                                                                                                placeholder: ":{alias}:",
                                                                                                                                alias: {
                                                                                                                                    1: "hehe",
                                                                                                                                    2: "haha",
                                                                                                                                    3: "tushe",
                                                                                                                                    4: "a",
                                                                                                                                    5: "ku",
                                                                                                                                    6: "lu",
                                                                                                                                    7: "kaixin",
                                                                                                                                    8: "han",
                                                                                                                                    9: "lei",
                                                                                                                                    10: "heixian",
                                                                                                                                    11: "bishi",
                                                                                                                                    12: "bugaoxing",
                                                                                                                                    13: "zhenbang",
                                                                                                                                    14: "qian",
                                                                                                                                    15: "yiwen",
                                                                                                                                    16: "yinxian",
                                                                                                                                    17: "tu",
                                                                                                                                    18: "yi",
                                                                                                                                    19: "weiqu",
                                                                                                                                    20: "huaxin",
                                                                                                                                    21: "hu",
                                                                                                                                    22: "xiaonian",
                                                                                                                                    23: "neng",
                                                                                                                                    24: "taikaixin",
                                                                                                                                    25: "huaji",
                                                                                                                                    26: "mianqiang",
                                                                                                                                    27: "kuanghan",
                                                                                                                                    28: "guai",
                                                                                                                                    29: "shuijiao",
                                                                                                                                    30: "jinku",
                                                                                                                                    31: "shengqi",
                                                                                                                                    32: "jinya",
                                                                                                                                    33: "pen",
                                                                                                                                    34: "aixin",
                                                                                                                                    35: "xinsui",
                                                                                                                                    36: "meigui",
                                                                                                                                    37: "liwu",
                                                                                                                                    38: "caihong",
                                                                                                                                    39: "xxyl",
                                                                                                                                    40: "taiyang",
                                                                                                                                    41: "qianbi",
                                                                                                                                    42: "dnegpao",
                                                                                                                                    43: "chabei",
                                                                                                                                    44: "dangao",
                                                                                                                                    45: "yinyue",
                                                                                                                                    46: "haha2",
                                                                                                                                    47: "shenli",
                                                                                                                                    48: "damuzhi",
                                                                                                                                    49: "ruo",
                                                                                                                                    50: "OK"
                                                                                                                                },
                                                                                                                                title: {
                                                                                                                                    1: "呵呵",
                                                                                                                                    2: "哈哈",
                                                                                                                                    3: "吐舌",
                                                                                                                                    4: "啊",
                                                                                                                                    5: "酷",
                                                                                                                                    6: "怒",
                                                                                                                                    7: "开心",
                                                                                                                                    8: "汗",
                                                                                                                                    9: "泪",
                                                                                                                                    10: "黑线",
                                                                                                                                    11: "鄙视",
                                                                                                                                    12: "不高兴",
                                                                                                                                    13: "真棒",
                                                                                                                                    14: "钱",
                                                                                                                                    15: "疑问",
                                                                                                                                    16: "阴脸",
                                                                                                                                    17: "吐",
                                                                                                                                    18: "咦",
                                                                                                                                    19: "委屈",
                                                                                                                                    20: "花心",
                                                                                                                                    21: "呼~",
                                                                                                                                    22: "笑脸",
                                                                                                                                    23: "冷",
                                                                                                                                    24: "太开心",
                                                                                                                                    25: "滑稽",
                                                                                                                                    26: "勉强",
                                                                                                                                    27: "狂汗",
                                                                                                                                    28: "乖",
                                                                                                                                    29: "睡觉",
                                                                                                                                    30: "惊哭",
                                                                                                                                    31: "生气",
                                                                                                                                    32: "惊讶",
                                                                                                                                    33: "喷",
                                                                                                                                    34: "爱心",
                                                                                                                                    35: "心碎",
                                                                                                                                    36: "玫瑰",
                                                                                                                                    37: "礼物",
                                                                                                                                    38: "彩虹",
                                                                                                                                    39: "星星月亮",
                                                                                                                                    40: "太阳",
                                                                                                                                    41: "钱币",
                                                                                                                                    42: "灯泡",
                                                                                                                                    43: "茶杯",
                                                                                                                                    44: "蛋糕",
                                                                                                                                    45: "音乐",
                                                                                                                                    46: "haha",
                                                                                                                                    47: "胜利",
                                                                                                                                    48: "大拇指",
                                                                                                                                    49: "弱",
                                                                                                                                    50: "OK"
                                                                                                                                }
                                                                                                                            },
                                                                                                                            {name: "萌萌哒",
                                                                                                                                path: "__PUBLIC__/emoji/img/qq/",
                                                                                                                                maxNum: 91,
                                                                                                                                excludeNums: [41, 45, 54],
                                                                                                                                file: ".gif"
                                                                                                                            }]
                                                                                                                    });

                                                                                                                    $('#reply_' + log_id).html('取消');
                                                                                                                } else {
                                                                                                                    $("#reparynow_" + log_id).slideToggle("3000");
                                                                                                                    $(this).attr('rel1', 0);
                                                                                                                    $('#reply_' + log_id).html('回复');
                                                                                                                }
                                                                                                            });

                                                                                                            $(document).on('focus', '.content_lanage', function () {
                                                                                                                var rel = $(this).attr('rel');
                                                                                                                $(".subit").removeAttr('disabled');
                                                                                                                $("#but_sub_" + rel).fadeIn("3000");
                                                                                                            });
                                                                                                            $(document).on('focusout', '.content_lanage', function () {
                                                                                                                var rel = $(this).attr('rel');
                                                                                                                var content = $(this).html();
                                                                                                                if (!content) {
                                                                                                                    $("#but_sub_" + rel).fadeOut("3000");
                                                                                                                    $(".subit").prop('disabled', true);
                                                                                                                    $(this).html('');
                                                                                                                }
                                                                                                            });

//点击发表后
                                                                                                            function add_after(log_id) {
                                                                                                                var log_id = log_id;
                                                                                                                $('#content_lanage_' + log_id).html('');
                                                                                                                $('#content_lanage_' + log_id).attr('placeholder');
                                                                                                                $("#but_sub_" + log_id).fadeOut("3000");
                                                                                                                $(".subit").prop('disabled', true);
                                                                                                            }
                                                                                                            /*
                                                                                                             *添加首次回复调用
                                                                                                             */
                                                                                                            $(document).on('click', '.add_language', function () {
                                                                                                                var log_id = $(this).attr('rel');
                                                                                                                var content_lanage = $('#content_lanage_' + log_id).html();
                                                                                                                $.post("{:U('log/myCommont')}", {content: content_lanage, log_id: log_id}, function (data) {
                                                                                                                    if (data.status == 1) {
                                                                                                                        add_after(log_id);//还原初始状态
                                                                                                                        var url = "{:U('log/commentShow')}";
                                                                                                                        $('#talkcontent_' + log_id).load(url, {log_id: log_id});
                                                                                                                        //收起评论
                                                                                                                        $('#log_comment_' + log_id).attr('rel1', 1);
                                                                                                                        $('#log_comment_' + log_id).html('收起评论');
                                                                                                                    } else {
                                                                                                                        alert_crm(data.info);
                                                                                                                    }
                                                                                                                }, "json"
                                                                                                                        );
                                                                                                            });

                                                                                                            /**日志评论end**/

                                                                                                            /**
                                                                                                             * 附件 如果是图片时 双击可查看大图
                                                                                                             */
                                                                                                            $('.litebox_file').liteBox({
                                                                                                                  revealSpeed: 400,
                                                                                                                  background: 'rgba(0,0,0,.8)',
                                                                                                                  overlayClose: true,
                                                                                                                  escKey: true,
                                                                                                                  navKey: true,
                                                                                                                  errorMessage: '图片加载失败.'
                                                                                                            });

//排序
                                                                                                            $(".sort-list").sortable({
                                                                                                                stop: function () {
                                                                                                                    var chart_arr = new Array();
                                                                                                                    $(".sort-item").each(function (key, val) {
                                                                                                                        chart_arr.push($(val).attr('rel'));
                                                                                                                        console.log($(val).attr('rel'));
                                                                                                                    });
                                                                                                                    $.post('{:U("index/sortCharts")}', {chart_arr: chart_arr.join(',')}, 'json');
                                                                                                                }
                                                                                                            });
//litebox
                                                                                                            $('.litebox').liteBox({
                                                                                                                  revealSpeed: 400,
                                                                                                                  background: 'rgba(0,0,0,.8)',
                                                                                                                  overlayClose: true,
                                                                                                                  escKey: true,
                                                                                                                  navKey: true,
                                                                                                                  errorMessage: '图片加载失败.'
                                                                                                            });

                                                                                                            $('#dialog-collection').dialog({
                                                                                                                autoOpen: false,
                                                                                                                modal: true,
                                                                                                                width: 930,
                                                                                                                maxHeight: 480,
                                                                                                                position: ["center", 100]
                                                                                                            });

                                                                                                            $('#dialog-message').dialog({
                                                                                                                autoOpen: false,
                                                                                                                modal: true,
                                                                                                                width: 600,
                                                                                                                maxHeight: 400,
                                                                                                                position: ["center", 100],
                                                                                                                buttons: {
                                                                                                                    "{:L('OK')}": function () {
                                                                                                                        $('#widget_add').submit();
                                                                                                                        $(this).dialog("close");
                                                                                                                    },
                                                                                                                    "{:L('CANCEL')}": function () {
                                                                                                                        $(this).dialog("close");
                                                                                                                    }
                                                                                                                }
                                                                                                            });

                                                                                                            $('#dialog-message2').dialog({
                                                                                                                autoOpen: false,
                                                                                                                modal: true,
                                                                                                                width: 600,
                                                                                                                maxHeight: 400,
                                                                                                                position: ["center", 100],
                                                                                                                buttons: {
                                                                                                                    "{:L('OK')}": function () {
                                                                                                                        $('#widget_edit').submit();
                                                                                                                        $(this).dialog("close");
                                                                                                                    },
                                                                                                                    "{:L('CANCEL')}": function () {
                                                                                                                        $(this).dialog("close");
                                                                                                                    }
                                                                                                                }
                                                                                                            });
                                                                                                            $("#dialog-role-info").dialog({
                                                                                                                autoOpen: false,
                                                                                                                modal: true,
                                                                                                                width: 600,
                                                                                                                minHeight: 420,
                                                                                                                position: ["center", 100]
                                                                                                            });

                                                                                                            $(function () {
                                                                                                                $("#add").click(
                                                                                                                        function () {
                                                                                                                            $('#dialog-message').dialog('open');
                                                                                                                            $('#dialog-message').load('{:U("index/widget_add")}');
                                                                                                                        }
                                                                                                                );
                                                                                                                $("#collection_target").click(function () {
                                                                                                                    $role_id = $(this).attr('rel');
                                                                                                                    $('#dialog-collection').dialog('open');
                                                                                                                    $('#dialog-collection').load('{:U("index/collection_add","owner_role_id=")}' + $role_id);
                                                                                                                });
                                                                                                                $(".update").click(
                                                                                                                        function () {
                                                                                                                            id = $(this).attr('rel');
                                                                                                                            $('#dialog-message2').dialog('open');
                                                                                                                            $('#dialog-message2').load("{:U('index/widget_edit','id=')}" + id);
                                                                                                                        }
                                                                                                                );
                                                                                                                $("#list").on("click", ".role_info", function () {
                                                                                                                    $role_id = $(this).attr('rel');
                                                                                                                    $('#dialog-role-info').dialog('open');
                                                                                                                    $('#dialog-role-info').load('{:U("user/dialoginfo","id=")}' + $role_id);
                                                                                                                });

                                                                                                                //包含下属
                                                                                                                $("#include_subordinates").click(function () {
                                                                                                                    var subordinates = $(this).is(':checked');
                                                                                                                    if (subordinates == true) {
                                                                                                                        window.location.href = "{:U('index/index', 'is_checked=')}" + 1;
                                                                                                                    } else {
                                                                                                                        window.location.href = "{:U('index/index', 'is_checked=')}" + 2;
                                                                                                                    }
                                                                                                                });
                                                                                                            });
                                                                                                            $(document).ready(function () {
                                                                                                                $("#list").on("click", ".map", function () {
                                                                                                                    $(this).next('.allmap').slideToggle('show');
                                                                                                                    var a = $(this).siblings('.longitude').attr('rel');
                                                                                                                    var b = $(this).siblings('.latitude').attr('rel');
                                                                                                                    var vals = $(this).next('.allmap').attr('rel');
                                                                                                                    var url = "{:U('index/gettranslocation')}" + "&longtitude=" + a + "&latitude=" + b;
                                                                                                                    $.get(url, function (data) {
                                                                                                                        var x = data.data.x;
                                                                                                                        var y = data.data.y;
                                                                                                                        setTimeout("mapInit(" + y + "," + x + "," + vals + ")", 1000);
                                                                                                                    })
                                                                                                                });
                                                                                                            });

                                                                                                            $("#dialog-role-info").dialog({
                                                                                                                autoOpen: false,
                                                                                                                modal: true,
                                                                                                                width: 600,
                                                                                                                maxHeight: 550,
                                                                                                                position: ["center", 100]
                                                                                                            });
                                                                                                            function mapInit(x, y, mapID) {
                                                                                                                var map = new BMap.Map(mapID);
                                                                                                                var point = new BMap.Point(y, x);
                                                                                                                map.centerAndZoom(point, 15);
                                                                                                                var marker = new BMap.Marker(point);  // 创建标注
                                                                                                                map.addOverlay(marker);               // 将标注添加到地图中
                                                                                                                map.enableScrollWheelZoom(true);
                                                                                                                marker.setAnimation(BMAP_ANIMATION_BOUNCE);
                                                                                                                /*
                                                                                                                 // 默认河南省郑州市
                                                                                                                 var map = new BMap.Map(mapID);
                                                                                                                 var point = new BMap.Point(y,x);
                                                                                                                 map.centerAndZoom(point,15);
                                                                                                                 // 根据聚焦点缩放
                                                                                                                 map.enableScrollWheelZoom(true);
                                                                                                                 
                                                                                                                 var marker = new BMap.Marker(point);  // 创建标注
                                                                                                                 map.addOverlay(marker);               // 将标注添加到地图中
                                                                                                                 //marker.setAnimation(BMAP_ANIMATION_BOUNCE);
                                                                                                                 
                                                                                                                 geoc.getLocation(point, function(rs){
                                                                                                                 //alert(rs.address);
                                                                                                                 });*/
                                                                                                            }

//任务
                                                                                                            /*任务详情 加载的圈圈效果*/
                                                                                                            var detail_html = '<div class="spiner-example">\
                                        <div class="sk-spinner sk-spinner-fading-circle">\
                                                <div class="sk-circle1 sk-circle"></div>\
                                                <div class="sk-circle2 sk-circle"></div>\
                                                <div class="sk-circle3 sk-circle"></div>\
                                                <div class="sk-circle4 sk-circle"></div>\
                                                <div class="sk-circle5 sk-circle"></div>\
                                                <div class="sk-circle6 sk-circle"></div>\
                                                <div class="sk-circle7 sk-circle"></div>\
                                                <div class="sk-circle8 sk-circle"></div>\
                                                <div class="sk-circle9 sk-circle"></div>\
                                                <div class="sk-circle10 sk-circle"></div>\
                                                <div class="sk-circle11 sk-circle"></div>\
                                                <div class="sk-circle12 sk-circle"></div>\
                                        </div>\
                                </div>';
//鼠标点击空白处，隐藏右侧滑出
                                                                                                            document.onmousedown = function (event) {
                                                                                                                if ($(".litebox-overlay").length > 0)
                                                                                                                    return;
                                                                                                                if ($("#dialog_open").val() == 1)
                                                                                                                    return;
                                                                                                                if (event.target.className == 'right-sidebar-toggle-task')
                                                                                                                    return;

                                                                                                                var div = document.getElementById("right-sidebar-task");
                                                                                                                var x = event.clientX;
                                                                                                                var y = event.clientY;
                                                                                                                var divx1 = div.offsetLeft;
                                                                                                                var divy1 = div.offsetTop;
                                                                                                                var divx2 = div.offsetLeft + div.offsetWidth;
                                                                                                                var divy2 = div.offsetTop + div.offsetHeight;
                                                                                                                if (x < divx1 || x > divx2 || y < divy1 || y > divy2) {
                                                                                                                    if ($("#right-sidebar-task").css('right') == '0px') {
                                                                                                                        $("#right-sidebar-task").animate({right: '-60%'}, 400);
                                                                                                                    }
                                                                                                                }
                                                                                                            }
//任务详情弹出
                                                                                                            $(document).on('click', '.task_view', function () {
                                                                                                                var task_id = $(this).attr('rel');
                                                                                                                // var is_show = document.getElementById("is_show").value;
                                                                                                                $(".emoji_container").remove();
                                                                                                                if ($("#right-sidebar-task").css('right') != '0px') {
                                                                                                                    $("#right-sidebar-task").animate({right: '0px'}, 600);
                                                                                                                }

                                                                                                                $('#task-content').html(detail_html);
                                                                                                                $('#sidebar-container').load("{:U('task/view','task_id=')}" + task_id);
                                                                                                            });
</script>
<include file="Public:footer" />

<div id="right-sidebar-task">
    <!--the css for jquery.mCustomScrollbar-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.mCustomScrollbar.min.css"/>
    <!--the css for this plugin-->
    <link rel="stylesheet" href="__PUBLIC__/emoji/css/jquery.emoji.css"/>
    <!--(Optional) the js for jquery.mCustomScrollbar's addon-->
    <script src="__PUBLIC__/emoji/js/jquery.mousewheel-3.0.6.min.js"></script>
    <!--the js for jquery.mCustomScrollbar-->
    <script src="__PUBLIC__/emoji/js/jquery.mCustomScrollbar.min.js"></script>
    <!--the js for this plugin-->
    <script src="__PUBLIC__/emoji/js/jquery.emoji.js"></script>

    <div class="sidebar-container" id="sidebar-container">

    </div>
</div>
